package com.meiyue.bean.entity;

import javax.persistence.*;

/**
 * MeiyueJavaProject
 * com.meiyue.bean.entity
 * Created by Chris Chen
 * 2017/9/14
 * Explain:
 */
@Entity
@Table(name = "test_provinces", schema = "test_yuedao", catalog = "")
public class TestProvincesEntity {
    private int id;
    private String province;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "province", nullable = false, length = 50)
    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TestProvincesEntity that = (TestProvincesEntity) o;

        if (id != that.id) return false;
        if (province != null ? !province.equals(that.province) : that.province != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (province != null ? province.hashCode() : 0);
        return result;
    }
}
